﻿using ModuleViewF.ViewModels;
using ModuleViewF.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;

namespace ModuleViewE
{
    public class ModuleViewFModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
            //注册ViewD到主程序的ContentRegion区域中
            var regionManager = containerProvider.Resolve<IRegionManager>();
            //regionManager.RegisterViewWithRegion("ContentRegion", typeof(ViewF));

            regionManager.Regions["ContentRegion"].RequestNavigate("ViewF");
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            //将视图类型 ViewF 和视图模型类型 ViewFViewModel 关联起来
            containerRegistry.RegisterForNavigation<ViewF, ViewFViewModel>();
        }
    }
}